using System;
using System.Collections.Generic;
using System.Text;
using emp.Model.SysManage;
using emp.IDAL.SysManage;
using System.Collections;

namespace emp.BLL.SysManage
{
    public class RoleUser
    {
        public int InsertByUser(RoleUserInfo myRoleUser)
        {
            // Validate input
            if (string.IsNullOrEmpty(myRoleUser.RoleIDStr))
            {
                return 0;
            }
            // Get an instance of the account DAL using the DALFactory
            IRoleUser dal = DALFactory.SysManage.RoleUser.Create();

            // Call the DAL to insert the account
            return dal.InsertByUser(myRoleUser);
        }

        public int InsertByRole(RoleUserInfo myRoleUser)
        {
            // Validate input
            if (string.IsNullOrEmpty(myRoleUser.UserIDStr))
            {
                return 0;
            }
            // Get an instance of the account DAL using the DALFactory
            IRoleUser dal = DALFactory.SysManage.RoleUser.Create();

            // Call the DAL to insert the account
            return dal.InsertByRole(myRoleUser);
        }

        public IList getListByUser(int iUserID)
        {
            // Get an instance of the account DAL using the DALFactory
            IRoleUser dal = DALFactory.SysManage.RoleUser.Create();

            // Send the udpated account information to the DAL
            return dal.getListByUser(iUserID);
        }

        public IList getListByRole(int iRoleID)
        {
            // Get an instance of the account DAL using the DALFactory
            IRoleUser dal = DALFactory.SysManage.RoleUser.Create();

            // Send the udpated account information to the DAL
            return dal.getListByRole(iRoleID);
        }
    }
}
